package com.weixing.mall.provider.controller.rpc;

import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.enums.IsReadEnum;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.core.support.auth.MemAuth;
import com.weixing.mall.core.support.auth.MemInfo;
import com.weixing.mall.provider.api.model.dto.MemberMessageDto;
import com.weixing.mall.provider.model.domain.MemberMessage;
import com.weixing.mall.provider.model.enums.MemberMsgTypeEnum;
import com.weixing.mall.provider.service.IMemberMessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName MemberMessageController
 * @Description TODO <br/>
 * @Author gjq
 * @Modified By:
 * @Date 2019/9/17
 * @Version 1.0
 **/

@RestController
@RequestMapping("/api/memberMessage")
@Api(value = "會員消息Api",tags = "会员消息")
public class MemberMessageRpcController extends BaseController {

    @Autowired
    private IMemberMessageService memberMessageService;

    @ApiOperation("")
    @PostMapping("createMsg")
    public Result  createMsg(@RequestBody MemberMessageDto memberMessage ){
       MemberMessage message = new MemberMessage();
        BeanUtils.copyProperties(memberMessage,message);
        memberMessageService.save(message);
        return ResultUtil.success();
    }



}
